<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>libcoap: subscribe.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectalign">
   <div id="projectname">libcoap<span id="projectnumber">&#160;4.2.0</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.8 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function() { init_codefold(0); });
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('subscribe_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="headertitle"><div class="title">subscribe.h</div></div>
</div><!--header-->
<div class="contents">
<a href="subscribe_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * subscribe.h -- subscription handling for CoAP</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *                see RFC7641</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> *</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> * Copyright (C) 2010-2012,2014-2015 Olaf Bergmann &lt;bergmann@tzi.org&gt;</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span><span class="comment"> *</span></div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="comment"> * This file is part of the CoAP library libcoap. Please see README for terms</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="comment"> * of use.</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span><span class="comment"> */</span></div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span> </div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span><span class="preprocessor">#ifndef COAP_SUBSCRIBE_H_</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="preprocessor">#define COAP_SUBSCRIBE_H_</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#include &quot;<a class="code" href="address_8h.html">address.h</a>&quot;</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#include &quot;<a class="code" href="coap__io_8h.html">coap_io.h</a>&quot;</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#include &quot;<a class="code" href="block_8h.html">block.h</a>&quot;</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="group__observe.html#ga8f172a982abdbb1c45fc5bdb90a23da4">   29</a></span><span class="preprocessor">#define COAP_OBSERVE_ESTABLISH 0</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"><a class="line" href="group__observe.html#ga51750fd894c457a4fe45f06c96641b2f">   35</a></span><span class="preprocessor">#define COAP_OBSERVE_CANCEL 1</span></div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span> </div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="preprocessor">#ifndef COAP_OBS_MAX_NON</span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="group__observe.html#ga823232351cb2bd203d2b34555f0c1d37">   43</a></span><span class="preprocessor">#define COAP_OBS_MAX_NON   5</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span><span class="preprocessor">#endif </span><span class="comment">/* COAP_OBS_MAX_NON */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno">   45</span> </div>
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno">   46</span><span class="preprocessor">#ifndef COAP_OBS_MAX_FAIL</span></div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="group__observe.html#gac0e2f9142cbad18a6a1989177fd0f5cb">   52</a></span><span class="preprocessor">#define COAP_OBS_MAX_FAIL  3</span></div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno">   53</span><span class="preprocessor">#endif </span><span class="comment">/* COAP_OBS_MAX_FAIL */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno">   54</span> </div>
<div class="foldopen" id="foldopen00056" data-start="{" data-end="};">
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html">   56</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="structcoap__subscription__t.html">coap_subscription_t</a> {</div>
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#aa751cbb82d18f3d8285ef5dcaa577d47">   57</a></span>  <span class="keyword">struct </span><a class="code hl_struct" href="structcoap__subscription__t.html">coap_subscription_t</a> *<a class="code hl_variable" href="structcoap__subscription__t.html#aa751cbb82d18f3d8285ef5dcaa577d47">next</a>; </div>
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a8bc2e1d3901d4618772278518f0cafb8">   58</a></span>  <a class="code hl_struct" href="structcoap__session__t.html">coap_session_t</a> *<a class="code hl_variable" href="structcoap__subscription__t.html#a8bc2e1d3901d4618772278518f0cafb8">session</a>;          </div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a8c83fc8034daa9f5c88b943698eeb466">   60</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structcoap__subscription__t.html#a8c83fc8034daa9f5c88b943698eeb466">non_cnt</a>:4;  </div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a83676881b25552592d3cb34e6d98431a">   61</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structcoap__subscription__t.html#a83676881b25552592d3cb34e6d98431a">fail_cnt</a>:2; </div>
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#aa330d1abe6d6690e0d1e7af528a02133">   62</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structcoap__subscription__t.html#aa330d1abe6d6690e0d1e7af528a02133">dirty</a>:1;    </div>
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a56a7321ec5cc87a67fdcecd0dc8e6525">   65</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code hl_variable" href="structcoap__subscription__t.html#a56a7321ec5cc87a67fdcecd0dc8e6525">has_block2</a>:1; </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a0a616d69d4b63843867180124541b1a8">   66</a></span>  <a class="code hl_struct" href="structcoap__block__t.html">coap_block_t</a> <a class="code hl_variable" href="structcoap__subscription__t.html#a0a616d69d4b63843867180124541b1a8">block2</a>;     </div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a91ab09d2d6b7ac8d2cc19fcaa64a45c1">   67</a></span>  <span class="keywordtype">size_t</span> <a class="code hl_variable" href="structcoap__subscription__t.html#a91ab09d2d6b7ac8d2cc19fcaa64a45c1">token_length</a>;     </div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a2945242d243578ad07362355b3e68c2d">   68</a></span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">char</span> <a class="code hl_variable" href="structcoap__subscription__t.html#a2945242d243578ad07362355b3e68c2d">token</a>[8];  </div>
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"><a class="line" href="structcoap__subscription__t.html#a3b72fe0111f2c937d9832b2660d7e901">   69</a></span>  <a class="code hl_struct" href="structcoap__string__t.html">coap_string_t</a> *<a class="code hl_variable" href="structcoap__subscription__t.html#a3b72fe0111f2c937d9832b2660d7e901">query</a>;    </div>
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"><a class="line" href="group__observe.html#gab0c93d8bdcb0a9db0178d0c46b7497ed">   70</a></span>} <a class="code hl_struct" href="structcoap__subscription__t.html">coap_subscription_t</a>;</div>
</div>
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno">   71</span> </div>
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno">   72</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__observe.html#gaa5db7653f7503be4810d593c5b61ed90">coap_subscription_init</a>(<a class="code hl_struct" href="structcoap__subscription__t.html">coap_subscription_t</a> *);</div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno">   73</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span><span class="preprocessor">#endif </span><span class="comment">/* COAP_SUBSCRIBE_H_ */</span><span class="preprocessor"></span></div>
<div class="ttc" id="aaddress_8h_html"><div class="ttname"><a href="address_8h.html">address.h</a></div><div class="ttdoc">Representation of network addresses.</div></div>
<div class="ttc" id="ablock_8h_html"><div class="ttname"><a href="block_8h.html">block.h</a></div></div>
<div class="ttc" id="acoap__io_8h_html"><div class="ttname"><a href="coap__io_8h.html">coap_io.h</a></div></div>
<div class="ttc" id="agroup__observe_html_gaa5db7653f7503be4810d593c5b61ed90"><div class="ttname"><a href="group__observe.html#gaa5db7653f7503be4810d593c5b61ed90">coap_subscription_init</a></div><div class="ttdeci">void coap_subscription_init(coap_subscription_t *)</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8c_source.html#l00020">subscribe.c:20</a></div></div>
<div class="ttc" id="astructcoap__block__t_html"><div class="ttname"><a href="structcoap__block__t.html">coap_block_t</a></div><div class="ttdoc">Structure of Block options.</div><div class="ttdef"><b>Definition</b> <a href="block_8h_source.html#l00036">block.h:36</a></div></div>
<div class="ttc" id="astructcoap__session__t_html"><div class="ttname"><a href="structcoap__session__t.html">coap_session_t</a></div><div class="ttdef"><b>Definition</b> <a href="coap__session_8h_source.html#l00056">coap_session.h:56</a></div></div>
<div class="ttc" id="astructcoap__string__t_html"><div class="ttname"><a href="structcoap__string__t.html">coap_string_t</a></div><div class="ttdoc">Coap string data definition.</div><div class="ttdef"><b>Definition</b> <a href="str_8h_source.html#l00025">str.h:25</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html"><div class="ttname"><a href="structcoap__subscription__t.html">coap_subscription_t</a></div><div class="ttdoc">Subscriber information.</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00056">subscribe.h:56</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a0a616d69d4b63843867180124541b1a8"><div class="ttname"><a href="structcoap__subscription__t.html#a0a616d69d4b63843867180124541b1a8">coap_subscription_t::block2</a></div><div class="ttdeci">coap_block_t block2</div><div class="ttdoc">GET request Block2 definition.</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00066">subscribe.h:66</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a2945242d243578ad07362355b3e68c2d"><div class="ttname"><a href="structcoap__subscription__t.html#a2945242d243578ad07362355b3e68c2d">coap_subscription_t::token</a></div><div class="ttdeci">unsigned char token[8]</div><div class="ttdoc">token used for subscription</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00068">subscribe.h:68</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a3b72fe0111f2c937d9832b2660d7e901"><div class="ttname"><a href="structcoap__subscription__t.html#a3b72fe0111f2c937d9832b2660d7e901">coap_subscription_t::query</a></div><div class="ttdeci">coap_string_t * query</div><div class="ttdoc">query string used for subscription, if any</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00069">subscribe.h:69</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a56a7321ec5cc87a67fdcecd0dc8e6525"><div class="ttname"><a href="structcoap__subscription__t.html#a56a7321ec5cc87a67fdcecd0dc8e6525">coap_subscription_t::has_block2</a></div><div class="ttdeci">unsigned int has_block2</div><div class="ttdoc">GET request had Block2 definition.</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00065">subscribe.h:65</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a83676881b25552592d3cb34e6d98431a"><div class="ttname"><a href="structcoap__subscription__t.html#a83676881b25552592d3cb34e6d98431a">coap_subscription_t::fail_cnt</a></div><div class="ttdeci">unsigned int fail_cnt</div><div class="ttdoc">up to 3 confirmable notifies can fail</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00061">subscribe.h:61</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a8bc2e1d3901d4618772278518f0cafb8"><div class="ttname"><a href="structcoap__subscription__t.html#a8bc2e1d3901d4618772278518f0cafb8">coap_subscription_t::session</a></div><div class="ttdeci">coap_session_t * session</div><div class="ttdoc">subscriber session</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00058">subscribe.h:58</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a8c83fc8034daa9f5c88b943698eeb466"><div class="ttname"><a href="structcoap__subscription__t.html#a8c83fc8034daa9f5c88b943698eeb466">coap_subscription_t::non_cnt</a></div><div class="ttdeci">unsigned int non_cnt</div><div class="ttdoc">up to 15 non-confirmable notifies allowed</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00060">subscribe.h:60</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_a91ab09d2d6b7ac8d2cc19fcaa64a45c1"><div class="ttname"><a href="structcoap__subscription__t.html#a91ab09d2d6b7ac8d2cc19fcaa64a45c1">coap_subscription_t::token_length</a></div><div class="ttdeci">size_t token_length</div><div class="ttdoc">actual length of token</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00067">subscribe.h:67</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_aa330d1abe6d6690e0d1e7af528a02133"><div class="ttname"><a href="structcoap__subscription__t.html#aa330d1abe6d6690e0d1e7af528a02133">coap_subscription_t::dirty</a></div><div class="ttdeci">unsigned int dirty</div><div class="ttdoc">set if the notification temporarily could not be sent (in that case, the resource's partially dirty f...</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00062">subscribe.h:62</a></div></div>
<div class="ttc" id="astructcoap__subscription__t_html_aa751cbb82d18f3d8285ef5dcaa577d47"><div class="ttname"><a href="structcoap__subscription__t.html#aa751cbb82d18f3d8285ef5dcaa577d47">coap_subscription_t::next</a></div><div class="ttdeci">struct coap_subscription_t * next</div><div class="ttdoc">next element in linked list</div><div class="ttdef"><b>Definition</b> <a href="subscribe_8h_source.html#l00057">subscribe.h:57</a></div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_a14d23a24002734ac2a3b997119f008e.html">coap2</a></li><li class="navelem"><a class="el" href="subscribe_8h.html">subscribe.h</a></li>
    <li class="footer">Generated on Fri Dec 27 2024 09:57:44 for libcoap by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.8 </li>
  </ul>
</div>
</body>
</html>
